import http from "@/sdk/tool/request.js"
const api = {
	//上传文件
	updaloadFile(callback){
		return http.upFile("/api/common/upload",callback)
	},
	//初始化
	getInit(){
		let url = "/addons/mumerchant/index/get_ini"
		return http.get(url)
	},
	//获取banner
	getBannerList(data){
		let url = "/addons/mumerchant/banner/get_banner"
		// console.log(data);
		return http.get(url,data,true)
	},
	//获取商品列表
	getGoodsList(data,loading){
		if(loading==undefined){
			loading = true;
		}
		let url = "/addons/mumerchant/goods/goods_list"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取商品分类
	getAtegoryList(){
		
		let url = "/addons/mumerchant/goods/get_ategory_list"
		// console.log(data);
		return http.post(url,{},true)
	},
	//获取商品详情
	getGoodsInfo(data,loading){
		if(loading==undefined){
			loading = true;
		}
		let url = "/addons/mumerchant/goods/get_goods_info"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//用户注册
	register(data,loading){
		if(loading==undefined){
			loading = true;
		}
		let url = "/addons/mumerchant/user/register"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//用户账号密码登录
	login(data,loading){
		if(loading==undefined){
			loading = true;
		}
		let url = "/addons/mumerchant/user/login"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//手机验证码登录
	codeLogin(data){
		let url = "/addons/mumerchant/user/mobilelogin"
		// console.log(data);
		return http.post(url,data,true)
	},
	//获取协议
	getAgreement(data,loading){
		if(loading==undefined){
			loading = false;
		}
		let url = "/addons/mumerchant/index/get_agreement"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取用户详情
	getUserInfo(){
		let url = "/addons/mumerchant/user/user_info"
		// console.log(data);
		return http.post(url,{},false)
	},
	//获取手机验证码
	getMobileCode(data){
		let url = "/addons/mumerchant/sms/send"
		// console.log(data);
		return http.post(url,data,true)
	},
	//修改手机号码
	changeMobile(data){
		let url = "/addons/mumerchant/user/changemobile"
		// console.log(data);
		return http.post(url,data,true)
	},
	//重置密码
	resetPwd(data){
		let url = "/addons/mumerchant/user/resetpwd"
		// console.log(data);
		return http.post(url,data,true)
	},
	//获取用户订单状态
	getOrderStatus(data){
		let url = "/addons/mumerchant/order/order_status"
		// console.log(data);
		return http.post(url,data,true)
	},
	//获取用户地址
	getUserAddress(data){
		let url = "/addons/mumerchant/address/get_list"
		// console.log(data);
		return http.post(url,data,true)
	},
	//获取城市
	getCitys(){
		let url = "/addons/mumerchant/index/get_citys"
		// console.log(data);
		return http.post(url,{},true)
	},
	//获取地址详情
	getAddressInfo(data){
		let url = "/addons/mumerchant/address/get_info"
		// console.log(data);
		return http.post(url,data,true)
	},
	//修改地址
	changeAddress(data){
		let url = "/addons/mumerchant/address/change"
		// console.log(data);
		return http.post(url,data,true)
	},
	//删除地址
	delAddress(data){
		let url = "/addons/mumerchant/address/delete"
		// console.log(data);
		return http.post(url,data,true)
	},
	//添加购物车
	changeShopCart(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/shopcart/change_cart"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取购物车
	getShopCartList(loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/shopcart/get_cart"
		// console.log(data);
		return http.post(url,{},loading)
	},
	//修改用户信息
	changeUser(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/user/profile"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//删除购物车
	delShopCart(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/shopcart/del_cart"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取运费/商品详情
	getPayOrder(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/payment/get_order_info"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//订单预支付(生成订单)
	createOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/create_order"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取支付订单详情
	getOrderPay(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/get_order_pay"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取银行列表
	getBankList(){
		let url = "/addons/mumerchant/index/get_banks"
		// console.log(data);
		return http.post(url,{},false)
	},
	//获取用户银行卡
	getUserCard(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/usercard/get_list"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//删除用户银行卡
	delUserCard(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/usercard/delete"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取用户银行卡
	changeUserCard(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/usercard/change"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取银行卡详情
	getCardInfo(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/usercard/get_info"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//支付订单
	pay(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/payment/pay"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取订单列表
	getOrderList(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/order/get_list"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//取消订单
	cancellationOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/cancellation"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//确认订单
	confimOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/confim"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//删除订单
	delOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/del"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//订单详情
	getOrderInfo(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/get_order_info"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//订单详情
	getTags(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/goods/get_tags"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//评论订单
	commentOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/comment"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取退款类型
	getRefundType(){
		let url = "/addons/mumerchant/order/refund_type"
		// console.log(data);
		return http.post(url,{})
	},
	//获取退款类型
	refundOrder(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/order/refund"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取物流信息
	getExpressLogs(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/order/get_express_logs"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取物流信息
	getGoodsComment(data,loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/goods/comment_list"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取关于我们
	getAbout(loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/index/get_about"
		// console.log(data);
		return http.post(url,{},loading)
	},
	//获取余额记录
	getBalanceLog(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/log/get_balance"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//获取提现类型
	getWithdrawalType(loading){
		if(loading ==undefined){
			loading = false
		}
		let url = "/addons/mumerchant/userwithdrawal/get_type"
		// console.log(data);
		return http.post(url,{},loading)
	},
	//提现
	withdrawal(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/userwithdrawal/withdrawal"
		// console.log(data);
		return http.post(url,data,loading)
	},
	//提现记录
	withdrawalLog(data,loading){
		if(loading ==undefined){
			loading = true
		}
		let url = "/addons/mumerchant/userwithdrawal/withdrawal_list"
		// console.log(data);
		return http.post(url,data,loading)
	}
}
export default api